%module CEGUIWindow

%{
#include "CEGUIWindow.h"
	%}

//#include "CEGUIBase.h"
%import "CEGUIString.i"
//#include "CEGUIVector.h"
//#include "CEGUIRect.h"
%import "CEGUISize.i"
//#include "CEGUIEventSet.h"
//#include "CEGUIPropertySet.h"
//#include "CEGUISystem.h"
//#include "CEGUIInputEvent.h"
//#include "CEGUIWindowProperties.h"
//#include "CEGUIUDim.h"
//#include "CEGUIWindowRenderer.h"
//#include "CEGUITextUtils.h"
//#include "CEGUIBasicRenderedStringParser.h"
//#include "CEGUIDefaultRenderedStringParser.h"
//#include <vector>
//#include <set>

namespace CEGUI
{
/*!
\brief
    Enumerated type used when specifying vertical alignments.
 */
enum VerticalAlignment
{
    /**
     * Window's position specifies an offset of it's top edge from the top edge
     * of it's parent.
     */
    VA_TOP,
    /**
     * Window's position specifies an offset of it's vertical centre from the
     * vertical centre of it's parent.
     */
    VA_CENTRE,
    /**
     * Window's position specifies an offset of it's bottom edge from the
     * bottom edge of it's parent.
     */
    VA_BOTTOM
};

/*!
\brief
    Enumerated type used when specifying horizontal alignments.
 */
enum HorizontalAlignment
{
    /**
     * Window's position specifies an offset of it's left edge from the left
     * edge of it's parent.
     */
    HA_LEFT,
    /**
     * Window's position specifies an offset of it's horizontal centre from the
     * horizontal centre of it's parent.
     */
    HA_CENTRE,
    /**
     * Window's position specifies an offset of it's right edge from the right
     * edge of it's parent.
     */
    HA_RIGHT
};

/*!
\brief
    Enumerated type used for specifying Window::update mode to be used.  Note
    that the setting specified will also have an effect on child window
    content; for WUM_NEVER and WUM_VISIBLE, if the parent's update function is
    not called, then no child window will have it's update function called
    either - even if it specifies WUM_ALWAYS as it's WindowUpdateMode.
*/
enum WindowUpdateMode
{
    //! Always call the Window::update function for this window.
    WUM_ALWAYS,
    //! Never call the Window::update function for this window.
    WUM_NEVER,
    //! Only call the Window::update function for this window if it is visible.
    WUM_VISIBLE
};

class Window //: public PropertySet, public EventSet
{
public:

    Window(const String& type, const String& name);

    virtual ~Window(void);

    const String& getType(void) const;

    const String& getName(void) const  {return d_name;}

    bool	isPropertyPresent(const String& name) const; 

    String	getProperty(const String& name) const; 

    void	setProperty(const String& name, const String& value); 


    bool isAlwaysOnTop(void) const  {return d_alwaysOnTop;}

    bool isDisabled(bool localOnly = false) const;

    bool isVisible(bool localOnly = false) const;

    bool isActive(void) const;

//    bool isChild(const String& name) const;

//    bool isChild(const Window* window) const;

    Window* getChild(const String& name) const;

    Window* getActiveChild(void);
    const Window* getActiveChild(void) const;

    bool isAncestor(const String& name) const;

//    bool isAncestor(const Window* window) const;

//    Font* getFont(bool useDefault = true) const;

    const String& getText(void) const {return d_textLogical;}

    //! return text string with \e visual ordering of glyphs.
    const String& getTextVisual() const;

    bool inheritsAlpha(void) const  {return d_inheritsAlpha;}

    float getAlpha(void) const  {return d_alpha;}

    static Window* getCaptureWindow(void)   {return d_captureWindow;}

//    bool isCapturedByThis(void) const   {return getCaptureWindow() == this;}

//    virtual bool isHit(const Vector2& position,
//                       const bool allow_disabled = false) const;

//    Window* getChildAtPosition(const Vector2& position) const;

    Window* getParent(void) const   {return d_parent;}

//    const Image* getMouseCursor(bool useDefault = true) const;

    Size getPixelSize(void) const    { return d_pixelSize; }

    void* getUserData(void) const   {return d_userData;}

    VerticalAlignment getVerticalAlignment() const  {return d_vertAlign;}

    HorizontalAlignment getHorizontalAlignment() const  {return d_horzAlign;}

    const String& getLookNFeel() const;

    bool getModalState(void) const;

    const String& getUserString(const String& name) const;

    bool isUserStringDefined(const String& name) const;

    Window* getActiveSibling();

    bool isMousePassThroughEnabled(void) const  {return d_mousePassThroughEnabled;}

    bool isAutoWindow(void) const   {return d_autoWindow;}

    bool isDragDropTarget() const;

    const Window* getRootWindow() const;
    Window* getRootWindow();

//    const Vector3& getRotation() const;

    bool isNonClientWindow() const;

    void rename(const String& new_name);

    void setDestroyedByParent(bool setting);

    void setAlwaysOnTop(bool setting);

    void setEnabled(bool setting);

    void enable(void)   {setEnabled(true);}

    void disable(void)  {setEnabled(false);}

    void setVisible(bool setting);

    void show(void)     {setVisible(true);}

    void hide(void)     {setVisible(false);}

    void activate(void);

    void deactivate(void);

    void setClippedByParent(bool setting);

    void setText(const String& text);

    void insertText(const String& text, const String::size_type position);

    void appendText(const String& text);

    void setFont(const String& name);


    void addChildWindow(const String& name);

    void addChildWindow(Window* window);

    void removeChildWindow(const String& name);

    void removeChildWindow(Window* window);

    void moveToFront();

    void moveToBack();

    void moveInFront(const Window* const window);

    void moveBehind(const Window* const window);

    void setAlpha(float alpha);

    void setInheritsAlpha(bool setting);

    void invalidate(const bool recursive);

    void setMouseCursor(const String& imageset, const String& image_name);

    void setUserData(void* user_data)   {d_userData = user_data;}

    void setTooltipText(const String& tip);

    void setVerticalAlignment(const VerticalAlignment alignment);

    void setHorizontalAlignment(const HorizontalAlignment alignment);

    void setModalState(bool state);

    void setUserString(const String& name, const String& value);

//    void setArea(const UDim& xpos, const UDim& ypos, const UDim& width, const UDim& height);

//    void setArea(const UVector2& pos, const UVector2& size);

//    void setArea(const URect& area);

//    void setPosition(const UVector2& pos);

//    void setXPosition(const UDim& x);

//    void setYPosition(const UDim& y);

//    void setSize(const UVector2& size);

//    void setWidth(const UDim& width);

//    void setHeight(const UDim& height);

//    void setMaxSize(const UVector2& size);

//    void setMinSize(const UVector2& size);

//    const URect& getArea() const;

//    const UVector2& getPosition() const;

//    const UDim& getXPosition() const;

//    UVector2 getSize() const;

//    UDim getWidth() const;

//    UDim getHeight() const;

//    const UVector2& getMaxSize() const;

//    const UVector2& getMinSize() const;

    void render();

    virtual void update(float elapsed);

    void setMousePassThroughEnabled(bool setting)   {d_mousePassThroughEnabled = setting;}

    void setDragDropTarget(bool setting);

//    void setNonClientWindow(const bool setting);

    bool isTextParsingEnabled() const;

    void setTextParsingEnabled(const bool setting);

//    virtual void setMargin(const UBox& margin);

//    const UBox& getMargin() const;

    bool isInFront(const Window& wnd) const;

    bool isBehind(const Window& wnd) const;

};

} // End of  CEGUI namespace section

